package cn.iocoder.yudao.module.aiposter.controller.app.minio;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.aiposter.controller.app.poster.vo.req.PosterGenerateReqVO;
import cn.iocoder.yudao.module.aiposter.controller.app.poster.vo.resp.PosterGenerateRespVO;
import cn.iocoder.yudao.module.aiposter.remote.ImgClient;
import cn.iocoder.yudao.module.aiposter.remote.vo.PreSignedUrlResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.validation.Valid;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "海报APP - Minio")
@RestController
@RequestMapping("/ai-poster/minio")
@Validated
public class OptionController {

    @Resource
    private ImgClient imgClient;

    @GetMapping("/presignedUrl")
    @Operation(summary = "生成海报")
    @PermitAll
    public CommonResult<PreSignedUrlResp> presignedUrl(@RequestParam("objectName") String objectName) {
        return success(imgClient.genPreSignedURL(objectName));
    }
}
